package com.sky.mapper;

import com.sky.dto.GoodsSalesDTO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Mapper
public interface ReportMapper {
    Double getCountByOrder(Map<String, Object> map);

    Integer getUserCount(Map<String, Object> map);
    @Select("select count(id) from orders where order_time > #{begin} and order_time < #{end}")
    Integer getOrderCount(Map<String, Object> map);
    @Select("select count(id) from orders where  order_time > #{begin} and order_time < #{end} and status = #{status}")
    Integer getValidOrderCount(Map<String, Object> orderMap);

    List<GoodsSalesDTO> getTop10(Map<String, Object> map);
}
